var t = getApp(), a = t.requirejs('core');
Page({
    data: {
        list: [],
        page: 1,
        total: 0,
        loaded: !1,
        loading: !0,
    },
    onLoad() {
        this.get_list()
    },
    get_list() {
        var t = this;
        t.setData({
            loading: !0
        }), a.get("yam/list/getlist", {page: this.data.page}, res => {
            // console.log(res);
            var e = {
                loading: !1,
                total: res.total,
                show: !0
            };
            res.articles || (res.articles = []), res.articles.length > 0 && (e.page = t.data.page + 1, e.list = t.data.list.concat(res.articles), 
            res.articles.length < res.pagesize && (e.loaded = !0)), t.setData(e);
        })
    },
    onPullDownRefresh: function() {
        wx.stopPullDownRefresh();
    },
    onReachBottom: function() {
        this.data.loaded || this.data.list.length == this.data.total || this.get_list();
    }
})